<template>
  <div class="body">
    <div class="body-box">
      <Breadcrumb />
      <TitleIcon :title-name="$t('查询条件')"></TitleIcon>
      <Form form-size="small" :props-form="form" :form-column="formColumn" @onSearch="onSearch">
        <template slot="customs-btn">
          <el-button class="create-button" size="small" type="primary" @click="handleCreate">{{
            $t('创建')
          }}</el-button>
        </template>
      </Form>
      <TitleIcon :title-name="$t('任务列表')"></TitleIcon>
      <TableList
        ref="tableRef"
        :loading="tableLoading"
        :table-data="tableData"
        :column-data="columnData"
        :page-change="pageChange"
        :total="total"
        :page-index="pageIndex"
        :page-size="pageSize"
      >
        <template slot="taskStatus" slot-scope="scope">
          <span :style="{ color: statusCodeToColor[scope.row.taskStatusCode] || '' }">{{ scope.row.taskStatus }}</span>
        </template>
        <template slot="message" slot-scope="scope">
          <div class="table-operate">
            <el-button @click="viewMessage(scope.row)">{{ $t('查看') }}</el-button>
          </div>
        </template>
        <template slot="executeJson" slot-scope="scope">
          <div class="executeJson-box" :title="scope.row.executeJson">{{ scope.row.executeJson }}</div>
        </template>
      </TableList>
    </div>
    <!-- 弹框 - dialogCreate -->
    <el-dialog
      v-if="dialogCreate.showDialog"
      :close-on-click-modal="false"
      :visible.sync="dialogCreate.showDialog"
      class="dialog-createTask"
      width="920px"
    >
      <Form
        ref="dialogCreateRef"
        :props-form="dialogCreate.form"
        :form-column="dialogCreateFormColumn"
        :empty-button="false"
        :search-button="false"
        :rules="dialogCreate.rules"
      >
      </Form>
      <div class="dialog-footer" style="margin: 10px 0">
        <el-button class="search-button" type="primary" size="small" @click="createTask">{{ $t('确认') }}</el-button>
      </div>
    </el-dialog>
    <!-- 弹框 - dialogMessage -->
    <el-dialog :visible.sync="dialogMessage.showDialog" :title="dialogMessage.title" class="dialog-dialogMessage">
      <div v-if="!(typeof dialogMessage.content === 'object' && dialogMessage.content !== null)" class="dialog-message">
        <p style="white-space: pre-wrap">{{ dialogMessage.content }}</p>
      </div>
      <div v-else class="dialog-message">
        <p>{{ dialogMessage.content.resultMsg }}</p>
        <div v-for="(item, idx) in dialogMessage.content.adjustmentAlarmList" :key="idx">
          <div v-if="item.bankBalanceAlarmVO">
            <TableList
              ref="tableDialogRef"
              :table-data="[
                {
                  ...item.bankBalanceAlarmVO,
                  period: item.period,
                  bankAccountNum: item.bankAccountNum,
                  bankAccountCode: item.bankAccountCode,
                  currencyCode: item.currencyCode,
                },
              ]"
              :column-data="dialogMessage.bankBalanceColumnData"
              :show-pagination="false"
            >
            </TableList>
          </div>
          <div v-else-if="item.accountBalanceAlarmVO">
            <TableList
              ref="tableDialogRef"
              :table-data="[
                {
                  ...item.accountBalanceAlarmVO,
                  period: item.period,
                  bankAccountNum: item.bankAccountNum,
                  currencyCode: item.currencyCode,
                },
              ]"
              :column-data="dialogMessage.accountBalanceAlarmColumnData"
              :show-pagination="false"
            >
            </TableList>
          </div>
          <div v-else-if="item.balanceCheckAlarmVO">
            <!-- :table-data="[{...item.balanceCheckAlarmVO, period: item.period}]" -->
            <TableList
              ref="tableDialogRef"
              :table-data="
                item.balanceCheckAlarmVO.recAccountBalances.map((i) => ({
                  ...item.balanceCheckAlarmVO,
                  segment3: i.segment3,
                  segment3Desc: i.segment3Desc,
                  glEndBalance: i.glEndBalance,
                  period: item.period,
                  bankAccountNum: item.bankAccountNum,
                  bankAccountCode: item.bankAccountCode,
                  currencyCode: item.currencyCode,
                }))
              "
              :column-data="dialogMessage.balanceCheckColumnData"
              :show-pagination="false"
              :span-method="spanMethod"
            >
            </TableList>
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script lang="ts">
import Vue from 'vue';
import { Component } from 'vue-property-decorator';

import Breadcrumb from '@/components/Breadcrumb';
import TitleIcon from '@/components/Title';
import Form from '@/components/Form';
import TableList from '@/components/TableList';
import { getTaskList, createTask, getTaskTypeList, getTaskIdList, getAccountForOverview } from '@/api/task';
import { getDsPeriodList, getReconciliationManagers, getTaskCreateByList, getBankAccountInfoList } from '@/api/common';
import { initForm } from '@/utils/tools';

@Component({
  components: {
    Breadcrumb,
    TitleIcon,
    Form,
    TableList,
  },
})
export default class TaskManagementSearch extends Vue {
  // 查询表单
  form: any = {};
  formColumn: any = [
    {
      name: 'taskTypeKey',
      type: 'select',
      label: this.$t('任务名称'),
      placeholder: this.$t('请选择'),
      options: [],
    },
    {
      name: 'taskId',
      type: 'select',
      label: this.$t('任务ID'),
      placeholder: this.$t('请选择'),
      options: [],
    },
    {
      name: 'executionStatus',
      type: 'select',
      label: this.$t('状态'),
      placeholder: this.$t('请选择'),
      options: [],
    },
    {
      name: 'taskCreateBy',
      type: 'select',
      label: this.$t('提交人'),
      placeholder: this.$t('请选择'),
      options: [],
    },
    {
      name: 'submitStartTimes',
      type: 'datetime',
      label: this.$t('提交时间从'),
      placeholder: this.$t('请选择'),
    },
    {
      name: 'submitEndTimes',
      type: 'datetime',
      label: this.$t('提交时间至'),
      placeholder: this.$t('请选择'),
    },
  ];

  // 表格
  tableData: any = [];
  total: number = 0;
  pageIndex: number = 1;
  pageSize: number = 5;
  tableLoading: boolean = false;
  statusCodeToColor: any = {
    ALARM: '#ffb24f',
    FAIL: '#ff5c5c',
  };
  columnData: any = [
    { key: 'id', label: this.$t('任务ID'), absoluteWidth: 90 },
    { key: 'taskName', label: this.$t('任务名称'), absoluteWidth: 100 },
    { key: 'submitTime', label: this.$t('提交时间'), absoluteWidth: 160 },
    { key: 'taskStatus', label: this.$t('状态'), absoluteWidth: 80, custom: true },
    { key: 'message', label: this.$t('任务输出'), custom: true, absoluteWidth: 90 },
    { key: 'taskCreateBy', label: this.$t('提交人'), absoluteWidth: 160 },
    { key: 'executeJson', label: this.$t('任务条件'), width: 260, custom: true },
    { key: 'taskStartTime', label: this.$t('执行时间'), absoluteWidth: 160 },
  ];

  // 弹框
  dialogCreate: any = {
    showDialog: false,
    bankInfo: {},
    bankNamesBefore: [],
    orgIdList: [],
    form: {},
    rules: {},
    formColumn: [
      {
        name: 'taskTypeKey',
        type: 'select',
        label: this.$t('任务类型'),
        placeholder: this.$t('请选择'),
        required: true,
        options: [],
      },
      {
        name: 'area',
        type: 'select',
        label: this.$t('区域'),
        placeholder: this.$t('请选择'),
        required: true,
        options: [
          {
            value: 'Y',
            label: this.$t('境内'),
          },
          {
            value: 'N',
            label: this.$t('境外'),
          },
        ],
        onChange: () => this.dialogCreateChange('area'),
      },
      {
        name: 'startDate',
        type: 'date',
        label: this.$t('日期从'),
        placeholder: this.$t('请选择'),
        required: true,
      },
      {
        name: 'endDate',
        type: 'date',
        label: this.$t('日期至'),
        placeholder: this.$t('请选择'),
        required: true,
        onChange: () => this.dialogCreateChange('endDate'),
      },
      {
        name: 'reconciliationBys',
        type: 'select',
        label: this.$t('对账责任人'),
        placeholder: this.$t('请选择'),
        required: true,
        options: [],
        onChange: () => this.dialogCreateChange('reconciliationBys'),
      },
      {
        name: 'orgIds',
        type: 'select',
        multiple: true,
        label: this.$t('OU'),
        placeholder: this.$t('请选择'),
        clearable: false,
        options: [],
        onChange: () => this.dialogCreateChange('orgIds'),
        onVisibleChange: (e) => this.dialogCreateVisibleChange('orgIds', e),
        onRemoveTag: () => this.dialogCreateRemoveTag('orgIds'),
      },
      {
        name: 'bankNames',
        type: 'select',
        label: this.$t('银行名称'),
        placeholder: this.$t('请选择'),
        clearable: false,
        multiple: true,
        options: [],
        onChange: () => this.dialogCreateChange('bankNames'),
        onVisibleChange: (e) => this.dialogCreateVisibleChange('bankNames', e),
        onRemoveTag: () => this.dialogCreateRemoveTag('bankNames'),
      },
      {
        name: 'period',
        type: 'month',
        label: this.$t('期间'),
        placeholder: this.$t('请选择'),
        required: true,
        options: [],
        onChange: () => this.dialogCreateChange('period'),
      },
      {
        name: 'bankAccountIdsForCreate',
        type: 'select',
        label: this.$t('账号'),
        placeholder: this.$t('请选择'),
        multiple: true,
        collapseTags: true,
        options: [],
      },
      {
        name: 'bankAccountIds',
        type: 'select',
        label: this.$t('账号'),
        placeholder: this.$t('请选择'),
        multiple: true,
        collapseTags: true,
        options: [],
        onChange: () => this.dialogCreateChange('bankAccountIds'),
      },
      {
        name: 'bankAccountCodes',
        type: 'select',
        label: this.$t('账户编号'),
        placeholder: this.$t('请选择'),
        multiple: true,
        collapseTags: true,
        options: [],
        onChange: () => this.dialogCreateChange('bankAccountCodes'),
      },
    ],
  };
  dialogMessage: any = {
    showDialog: false,
    content: '',
    title: this.$t('任务输出'),
    isCreateTable: false,
    period: '',

    bankBalanceColumnData: [
      { key: 'bankAccountNum', label: this.$t('账号'), width: 120 },
      { key: 'bankAccountCode', label: this.$t('账户编号'), width: 120 },
      { key: 'currencyCode', label: this.$t('币种'), width: 80 },
      { key: 'period', label: this.$t('月份'), width: 120 },
      { key: 'bankBeginBalance', label: this.$t('期初余额'), amount: true, width: 160 },
      { key: 'bankAmountDr', label: this.$t('收入'), amount: true, width: 160 },
      { key: 'bankAmountCr', label: this.$t('支出'), amount: true, width: 160 },
      { key: 'bankEndBalance', label: this.$t('期末余额'), amount: true, width: 160 },
      { key: 'difference', label: this.$t('差异'), amount: true, width: 160 },
    ],
    accountBalanceAlarmColumnData: [
      { key: 'period', label: this.$t('期间'), width: 80 },
      { key: 'bankAccountNum', label: this.$t('银行账户'), width: 120 },
      { key: 'segment1', label: this.$t('OU'), width: 80 },
      { key: 'currencyCode', label: this.$t('币种'), width: 80 },
      { key: 'segment3', label: this.$t('科目'), width: 120 },
      { key: 'description', label: this.$t('说明'), width: 280 },
    ],

    balanceCheckColumnData: [
      { key: 'bankAccountNum', label: this.$t('账号'), width: 120 },
      { key: 'bankAccountCode', label: this.$t('账户编号'), width: 120 },
      { key: 'currencyCode', label: this.$t('币种'), width: 80 },
      { key: 'period', label: this.$t('月份'), width: 120 },
      { key: 'bankEndBalance', label: this.$t('银行期末余额'), amount: true, width: 160 },
      { key: 'reconciliationBalance', label: this.$t('调节后余额'), amount: true, width: 160 },
      { key: 'segment3', label: this.$t('科目代码'), width: 120 },
      { key: 'segment3Desc', label: this.$t('科目描述'), width: 180 },
      { key: 'glEndBalance', label: this.$t('账面期末余额'), amount: true, width: 160 },
      { key: 'trialBalanceAmount', label: this.$t('试算平衡金额'), amount: true, width: 160 },
    ],
  };

  public get dialogCreateFormColumn(): any {
    if (this.dialogCreate.form.taskTypeKey === 'synBankAccount') {
      return this.dialogCreate.formColumn.filter((i) =>
        ['taskTypeKey', 'period', 'bankAccountIdsForCreate'].includes(i.name),
      );
    } else {
      return this.dialogCreate.formColumn.filter((i) => !['period', 'bankAccountIdsForCreate'].includes(i.name));
    }
  }

  // 初始化
  mounted() {
    this.init();
  }

  async init() {
    this.form = initForm(this.formColumn);
    await this.getOptions();
    this.getFlowData();
    this.setRules();
  }

  setRules() {
    this.dialogCreate.formColumn.map((i) => {
      if (i.required) {
        this.dialogCreate.rules[i.name] = [{ required: true, message: this.$t(`${i.placeholder}`) }];
      }
    });
  }

  // 获取下拉选项
  async getOptions() {
    // 获取查询条件枚举
    this.selectTaskTypeNewOptions();
    this.taskIdOptions();
    await this.taskCreateByOptions();
  }

  // 查询条件枚举
  // Options-任务名称
  async selectTaskTypeNewOptions() {
    // const res = (await getSelectTaskTypeNew({ module: 'reconciliation' })) || [];
    const res1 = await getTaskTypeList({ onlyCreateAble: false });
    this.formColumn.find((item) => item.name === 'taskTypeKey').options = res1.data;
    const res2 = await getTaskTypeList({ onlyCreateAble: true });
    this.dialogCreate.formColumn.find((item) => item.name === 'taskTypeKey').options = res2.data;
  }
  // Options-任务ID
  async taskIdOptions() {
    const res = await getTaskIdList();
    this.formColumn.find((item) => item.name === 'taskId').options = res.data.map((i) => ({
      value: i,
      label: i,
    }));
  }
  // Options-提交人/状态
  async taskCreateByOptions() {
    const res1 = await getTaskCreateByList({ type: 'recKVTaskCreators' });
    const res2 = await getTaskCreateByList({ type: 'TaskStatus' });
    this.formColumn.find((item) => item.name === 'taskCreateBy').options = (res1.data || []).map((i) => ({
      value: i.key,
      label: i.value,
    }));
    this.form.taskCreateBy = ((res1.data || []).find(i=>i.value === this.$store.state.userInfo.userFullName) || {}).key;
    this.formColumn.find((item) => item.name === 'executionStatus').options = (res2.data || []).map((i) => ({
      value: i.key,
      label: i.value,
    }));
  }

  // 创建表单枚举
  /**
   * 层级关系：
   * 对账责任人、区域、日期至 -> OU -> 银行 -> 账号
   * */
  // 获取OU和银行信息枚举
  async getBankInfo() {
    if (!this.dialogCreate.form.endDate) {
      this.dialogCreate.bankInfo = {};
      return;
    }
    let params = {
      reconciliationManager: this.dialogCreate.form.reconciliationBys,
      domesticAndForeign: this.dialogCreate.form.area,
      orgIdList: this.dialogCreate.form.orgIds,
      bankNameList: this.dialogCreate.form.bankNames,
      dateTo: this.dialogCreate.form.endDate,
    };
    // if (!(params.orgIdList && params.orgIdList.length > 0)) {
    //   params.orgIdList = this.dialogCreate.orgIdList;
    // }
    const res = await getBankAccountInfoList(params);
    if (res.code === 2000) {
      this.dialogCreate.bankInfo = res.data;
    }
  }
  // Options-对账责任人
  async reconciliationManagersOptions() {
    if (!this.dialogCreate.form.endDate) {
      this.dialogCreate.formColumn.find((item) => item.name === 'reconciliationBys').options = [];
      return;
    }
    const res = await getReconciliationManagers({ period: this.dialogCreate.form.endDate.substring(0, 7) });
    const Options = (this.dialogCreate.formColumn.find((item) => item.name === 'reconciliationBys').options = res.map(
      (i) => ({
        value: i,
        label: i,
      }),
    ));
    if (Options.findIndex((i) => i.value === this.$store.state.userInfo.userFullName) > -1) {
      this.dialogCreate.form.reconciliationBys = this.$store.state.userInfo.userFullName;
    }
  }
  // Options-OU
  async orgIdListOptions() {
    this.dialogCreate.formColumn.find((item) => item.name === 'orgIds').options = this.dialogCreate.bankInfo
      ? (this.dialogCreate.bankInfo.orgVOList || []).map((i) => ({
          value: i.orgId,
          label: i.ouShortNameZhs,
        }))
      : [];
  }
  // Options-银行名称
  async bankNameListOptions() {
    this.dialogCreate.formColumn.find((item) => item.name === 'bankNames').options = this.dialogCreate.bankInfo
      ? (this.dialogCreate.bankInfo.bankNames || []).map((i) => ({
          value: i,
          label: i,
        }))
      : [];
  }
  // Options-账号
  async bankListOptions() {
    this.dialogCreate.formColumn.find((item) => item.name === 'bankAccountIds').options = this.dialogCreate.bankInfo
      ? (this.dialogCreate.bankInfo.bankAccountIdMap || []).map((i) => ({ value: i.key, label: i.value }))
      : [];
    this.dialogCreate.formColumn.find((item) => item.name === 'bankAccountCodes').options = this.dialogCreate.bankInfo
      ? (this.dialogCreate.bankInfo.bankAccountCodeMap || []).map((i) => ({ value: i.key, label: i.value }))
      : [];
  }

  async bankAccountIdsForCreateOptions() {
    if (!this.dialogCreate.form.period) {
      this.dialogCreate.formColumn.find((item) => item.name === 'bankAccountIdsForCreate').options = [];
      return;
    }
    let params = {
      period: this.dialogCreate.form.period,
    };
    const res = await getAccountForOverview(params);

    if (res.code === 2000) {
      this.dialogCreate.formColumn.find((item) => item.name === 'bankAccountIdsForCreate').options = res.data ? (res.data || []).map((i) => ({ value: i.key, label: i.value })) : [];
    }
  }

  // 表格-获取数据
  async getFlowData() {
    this.tableLoading = true;
    const res = await getTaskList({
      current: this.pageIndex,
      pageSize: this.pageSize,
      ...this.form,
    });
    if (res.code === 2000) {
      this.tableData = res.data.dataList ? res.data.dataList : [];
      this.total = res.data.total ? res.data.total : 0;
      this.tableLoading = false;
    }
  }
  // 表格-分页
  pageChange(val) {
    this.pageSize = val.pageSize;
    this.pageIndex = val.pageIndex;
    this.getFlowData();
  }
  // 表格-显示详情
  viewMessage(row) {
    this.dialogMessage.isCreateTable = row.taskName === this.$t('生成调节表');
    if (this.dialogMessage.isCreateTable) {
      try {
        this.dialogMessage.content = JSON.parse(row.message.content);
      } catch (e) {
        this.dialogMessage.content = row.message.content;
      }
    } else {
      this.dialogMessage.content = row.message.content;
    }
    this.dialogMessage.showDialog = true;
    this.$nextTick(() => {
      const tableDialogRef = this.$refs.tableDialogRef as any;
      if (Array.isArray(tableDialogRef) && tableDialogRef.length > 0) {
        tableDialogRef.map((i) => (i.$refs.multipleTable.$el.querySelector('.el-table__body-wrapper').scrollLeft = 0));
      }
    });
  }

  // 表单-查询
  async onSearch(val) {
    this.form = val;
    this.pageIndex = 1;
    this.getFlowData();
  }
  // 表单-创建
  async handleCreate() {
    this.dialogCreate.form = initForm(this.dialogCreate.formColumn);
    if (
      this.dialogCreate.formColumn
        .find((item) => item.name === 'reconciliationBys')
        .options.findIndex((i) => i.value === this.$store.state.userInfo.userFullName) > -1
    ) {
      this.dialogCreate.form.reconciliationBys = this.$store.state.userInfo.userFullName;
    }
    // await this.getBankInfo(); // 获取OU和银行信息枚举
    // this.orgIdListOptions(); // OU枚举
    // this.bankNameListOptions(); // 银行名称枚举
    // this.bankListOptions(); // 账号枚举
    this.dialogCreate.showDialog = true;
  }

  // 弹框-确认
  async createTask() {
    (this.$refs.dialogCreateRef as any).$refs['form'].validate(async (valid: any) => {
      if (valid) {
        let params;
        if (this.dialogCreate.form.taskTypeKey === 'synBankAccount') {
          params = {
            taskTypeKey: this.dialogCreate.form.taskTypeKey,
            period: this.dialogCreate.form.period,
            bankAccountIds: this.dialogCreate.form.bankAccountIdsForCreate.map((i) => Number(i)),
          };
        } else {
          params = {
            ...this.dialogCreate.form,
            orgIds: this.dialogCreate.form.orgIds.map((i) => Number(i)),
            bankAccountIds: this.dialogCreate.form.bankAccountIds.map((i) => Number(i)),
            bankAccountCodes: undefined,
            period: undefined,
            bankAccountIdsForCreate: undefined,
          };
        }
        const res = await createTask(params);
        if (res.code === 2000) {
          this.$message.success(`${this.$t('创建成功')}`);
          this.dialogCreate.showDialog = false;
          this.getFlowData();
        }
      }
      // else {
      //   this.$message({
      //     message: `${this.$t('请填写必填项')}`,
      //     type: 'error',
      //   });
      // }
    });
  }
  /**
   * 弹框-联动清空
   * 两种情况需要清空
   * 1.多选项由0->x
   * 2.多选项有选项删除 且 不是由x->0
   * */
  async dialogCreateChange(name) {
    if (name === 'reconciliationBys') {
      this.dialogCreate.form.orgIds = [];
      this.dialogCreate.form.bankNames = [];
      this.dialogCreate.form.bankAccountIds = [];
      this.dialogCreate.form.bankAccountCodes = [];
      await this.getBankInfo();
      this.orgIdListOptions();
      this.bankNameListOptions();
      this.bankListOptions();
    } else if (name === 'area') {
      this.dialogCreate.form.orgIds = [];
      this.dialogCreate.form.bankNames = [];
      this.dialogCreate.form.bankAccountIds = [];
      this.dialogCreate.form.bankAccountCodes = [];
      await this.getBankInfo();
      this.orgIdListOptions();
      this.bankNameListOptions();
      this.bankListOptions();
    } else if (name === 'period') {
      this.dialogCreate.form.bankAccountIdsForCreate = [];
      this.bankAccountIdsForCreateOptions();
    } else if (name === 'endDate') {
      this.dialogCreate.form.orgIds = [];
      this.dialogCreate.form.bankNames = [];
      this.dialogCreate.form.bankAccountIds = [];
      this.dialogCreate.form.bankAccountCodes = [];
      this.dialogCreate.form.reconciliationBys = '';
      await this.getBankInfo();
      this.reconciliationManagersOptions();
      this.orgIdListOptions();
      this.bankNameListOptions();
      this.bankListOptions();
    } else if (name === 'orgIds') {
      this.dialogCreate.form.bankNames = [];
      this.dialogCreate.form.bankAccountIds = [];
      this.dialogCreate.form.bankAccountCodes = [];
    } else if (name === 'bankNames') {
      const isClear =
        (this.dialogCreate.form.bankNames.length !== 0 &&
          this.dialogCreate.bankNamesBefore.findIndex((i) => !this.dialogCreate.form.bankNames.includes(i)) > -1) ||
        this.dialogCreate.bankNamesBefore.length === 0;
      if (isClear) {
        this.dialogCreate.form.bankAccountIds = [];
        this.dialogCreate.form.bankAccountCodes = [];
      }
    } else if (name === 'bankAccountIds') {
      this.dialogCreate.form.bankAccountCodes = this.dialogCreate.form.bankAccountIds;
    } else if (name === 'bankAccountCodes') {
      this.dialogCreate.form.bankAccountIds = this.dialogCreate.form.bankAccountCodes;
    }
  }
  // 弹框-下拉框收回 将重新获取Options
  async dialogCreateVisibleChange(name, isOpen) {
    if (isOpen) return;
    await this.getBankInfo();
    if (name === 'orgIds') {
      this.bankNameListOptions();
      this.bankListOptions();
    } else if (name === 'bankNames') {
      this.bankListOptions();
      this.dialogCreate.bankNamesBefore = this.dialogCreate.form.bankNames;
    }
  }
  // 弹框-移除Tag重新获取Options
  async dialogCreateRemoveTag(name) {
    await this.getBankInfo();
    if (name === 'orgIds') {
      this.bankNameListOptions();
      this.bankListOptions();
    } else if (name === 'bankNames') {
      this.bankListOptions();
      this.dialogCreate.bankNamesBefore = this.dialogCreate.form.bankNames;
    }
  }
  // 弹框-表格合并行
  spanMethod({ row, column, rowIndex, columnIndex }, total) {
    if (![5, 6, 7].includes(columnIndex)) {
      if (rowIndex === 0) {
        return [total, 1];
      } else {
        return [0, 0];
      }
    }
  }
}
</script>

<style lang="less" scoped>
@import './index.less';
</style>
